<template>
  <div>
        <!-- 显示 -->
    <!-- <el-card class="box-card"> -->
      <el-tag v-for="(item,index) in $store.state.navlist" :key="index" >
          <router-link :to="'/'+item.index">
      <span>{{ item.title }}<i class="el-icon-close" @click='del(index)'></i></span>
      </router-link>
      </el-tag>
      <!-- 下拉 -->
      <el-button type='danger' class="flr">
   <el-dropdown >
  <span class="el-dropdown-link">标签选项
    <i class="el-icon-arrow-down el-icon--right"></i>
  </span>
  <el-dropdown-menu slot="dropdown">
    <el-dropdown-item >关闭其他</el-dropdown-item>
    <el-dropdown-item><button @click='$store.state.navlist=[]'>关闭所有</button> </el-dropdown-item>
  </el-dropdown-menu>
</el-dropdown>
      </el-button>
   
    <!-- </el-card> -->
  </div>
</template>


<script>
export default {
  name: "",
  components: {},
  props: [],
  data() {
    return {
        
    };
  },
  mounted() {},
  methods: {
    // commit方法
      del(id){
          console.log(id)
          this.$store.commit('del',id)
      },
    
    
  },
  computed: {
  
  },
  watch: {},
  created() {},
};
</script>


<style scoped>
a{
     text-decoration: none;
}
.flr{
    float: right;
    display: flex;
    align-items:center;
}


</style>